Chain-of-thought Prompting

Category: AI
AI Prompt
write an explanation for Chain-of-thought Prompting

MIT/Sloan - Vendor Definition

Chain-of-thought prompting is when you use a series of intermediate reasoning steps to improve the accuracy and applicability of answers generated by LLMs (Bubeck et al., 2022).

Two speech bubbles with a question mark inside of them.
A black apple logo on a white background.

Apple Intelligence

Chain-of-thought prompting is a technique for generating text that resembles a human-generated conversation. It works by generating a chain of text, where each word is generated based on the previous word. The chain of text is then presented to the user as a prompt, and the user is asked to write a response. The response is then used to generate the next word in the chain, and so on.

A white background with a few lines on it

Anthropic Claude

#NAME?

Chain-of-thought prompting is a technique used to improve the reasoning abilities of large language models (LLMs). It encourages the model to break down complex problems into a series of smaller, more manageable steps, similar to how humans think through problems.  

Think of it like this:

Instead of asking an LLM a question directly and expecting a single answer, you guide it through the reasoning process by providing a few examples of how to solve similar problems step-by-step. This "chain of thought" helps the model understand the underlying logic and apply it to new situations.  

Here's how it works:

Provide a few examples: Show the LLM a few questions with their corresponding answers, but also include the intermediate reasoning steps that lead to those answers.  
Ask a new question: Present the LLM with a new, unseen question.
Encourage reasoning: Prompt the LLM to "think step by step" or "let's think about this" to encourage it to generate its own chain of thought before arriving at the answer.  
Example:

Question: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?  
Chain-of-thought prompt:
Roger starts with 5 balls.  
2 cans * 3 balls/can = 6 balls.  
Roger has 5 + 6 = 11 balls.  
Answer: 11
 
By seeing this example, the LLM learns to break down the problem into smaller steps, perform the necessary calculations, and arrive at the correct answer.  

Why is chain-of-thought prompting effective?

Improved reasoning: It encourages LLMs to explicitly demonstrate their reasoning process, leading to more accurate and logical answers.  
Better generalization: It helps LLMs learn to apply reasoning skills to new problems, even if they haven't seen those specific problems before.
Increased transparency: It provides insights into how the LLM arrived at its answer, making it easier to understand and trust its decisions.  
Types of chain-of-thought prompting:

Manual chain-of-thought prompting: Manually creating examples with reasoning steps.
Automatic chain-of-thought prompting: Using LLMs themselves to generate reasoning chains.  
Zero-shot chain-of-thought prompting: Using prompts like "Let's think step by step" without providing any examples.  
Applications of chain-of-thought prompting:

Solving math word problems
Answering common sense questions
Generating explanations for complex concepts
Performing multi-step reasoning tasks
Chain-of-thought prompting is a powerful technique that enhances the reasoning abilities of LLMs, making them more capable of solving complex problems and providing more insightful answers.

A white background with a few lines on it

Advanced

A black and white drawing of a cloud on a white background.

GPT4o

#NAME?